Integrated circuit technology has revolutionized various fields, including computers, control systems, telecommunications, and imaging. One field in which integrated circuitry is widely used is video imaging. Different types of semiconductor imagers include: charge coupled devices, photodiode arrays, charge injection devices, and hybrid focal plane arrays. Many of these devices include pixels that are arranged in sensor arrays to convert light images into electrical signals.
It is desirable in image sensors to remove noise from the signals that originate at the pixels and pass through the image sensor circuitry. One type of filter that has found an increasing application in image processing are median filters. As discussed in a paper titled "An Analog Circuit Technique for Finding the Median" by P. Dietz and R. Carley, IEEE 1993, Custom Integrated Circuits Conference, pp. 6.1.1-6.1.4, median filters have increased in use due to their ability to perfectly reject isolated impulse noise while preserving signal step changes.
FIG. 1A illustrates a traditional median filter 8. Median filter 8 includes three transconductance amplifiers 20a, 20b, and 20c. Transconductance amplifier 20a receives an input V1 at its noninverting input, while transconductance amplifier 20b receives an input V2 at its noninverting input, and transconductance amplifier 20c receives an input V3 at its noninverting input. The outputs of the transconductance amplifiers 20a, 20b, and 20c are tied together at an output V.sub.out. The output V.sub.out is fed back to the transconductance amplifiers 20a, 20b, and 20c at their inverting inputs. Transconductance amplifier 20a has an output current I.sub.20a, while transconductance amplifier 20b has an output current I.sub.20b, and transconductance amplifier 20c has an output current I.sub.20c.
FIG. 1B shows timing diagrams illustrating the operation of the median filter 8 of FIG. 1A. As illustrated in FIG. 1B, at time t0, the input V1 to amplifier 20a is at 3.5 volts, while the input V2 to amplifier 20b is at 2.5 volts, and the input V3 to amplifier 20c is at 2 volts. The output V.sub.out of median filter 8 is shown to be at 2.5 volts since, as will be described in more detail below, the output V.sub.out is following the input V2 at this time, since the input V2 is the median input of the three inputs at time t0.
The reasons why the output V.sub.out follows the median input can be explained with respect to the operating states of the individual amplifiers 20a, 20b, and 20c. As described above, at time t0, the noninverting input of amplifier 20a is at 3.5 volts, while the inverting input is at 2.5 volts. Assuming that the maximum range of the differential between the two inputs that can be amplified is a few millivolts, then the 1.0 positive volt input differential at time t0 will cause amplifier 20a to output its maximum positive current I.sub.max. Meanwhile, the amplifier 20c has a voltage of 2.0 volts at its noninverting input and a voltage of 2.5 volts at its inverting input. This 0.5 negative volt input differential state, similar to amplifier 20a, causes the amplifier 20c to output its maximum negative current -I.sub.max. The maximum positive current I.sub.max from the amplifier 20a and the maximum negative current -I.sub.max from amplifier 20c offset one another. The remaining amplifier 20b is thus left in a feedback loop configuration, whereby the output of the amplifier will follow the input voltage V2 at the noninverting input, as is well known in the art. Thus, in most states where the differential inputs are sufficient, this process will occur for whichever of the three amplifiers 20a, 20b, or 20c has the median input, while the higher and lower amplifiers will output offsetting maximum and minimum currents, respectively. Thus, the output of median filter 8 will follow the median input of the three input voltages V1, V2, or V3.
Returning to FIG. 1B, at time t1, input voltage V3 begins trending upward. At time t2, input voltage V3 crosses input voltage V2 at the 2.5 volt level. After time t2, the output V.sub.out of median filter 8 begins following the input voltage V3 of amplifier 20c. As described above, the output V.sub.out begins following the input V3 because the differential input voltages will cause the amplifier 20a to continue to output a positive maximum current I.sub.max, while the amplifier 20b will begin to output a negative maximum current -I.sub.max. This leaves amplifier 20c to output a voltage which follows the input V3 due to the feedback configuration.
At time t3, the input V3 crosses the input V1 at the 3.5 volt level. Following time t3, the output V.sub.out of median filter 8 begins to follow the input V1 of amplifier 20a. As described above, this occurs because differential input voltages will cause the amplifier 20b to continue to output a negative maximum current -I.sub.max, while the amplifier 20c will begin to output a positive maximum current I.sub.max. This leaves amplifier 20a to output a voltage which follows the input V1 due to the feedback configuration.
The operation of the median filter 8 illustrated above allows the median filter to effectively reject impulse noise, while preserving the signal step changes. However, certain problems have arisen with regard to the use of median filters in image processing. One publication which discusses some of the problems with median filters is "A New Analog Median Filter," by Shang-Yi Lin and Tzi-Dar Chiueh, published by the Department of Electrical Engineering of the National Taiwan University, Taipei, Taiwan 10617. As discussed in that paper, traditional implementations of the amplifiers such as 10a, 10b, and 10c of analog median filters have been based on several transconductors in a feedback configuration with their outputs connected together. The most common transconductor used in such systems is a differential pair. However, the finite slope of the I-V curve of the differential pair has tended to blunt the corners of the transfer curve. The linear range of traditional differential pairs can be expressed as follows: ##EQU1## Where I.sub.SS is the bias current of the differential pair, .beta. is (W/L)U.sub.ox C, and V.sub.ID is the differential input voltage. Bipolar technology provides no direct method for enlarging the linear range of the differential pair because the linear range is independent of the bias current and transistor size. In a CMOS implementation, there is strong interdependence between the transconductance and the width of the linear range. Two of the simplest ways to increase the transconductance of the differential pair are to increase the bias current or to increase the ratio of W/L. However, such methods require more power consumption and/or larger chip area.
FIGS. 2A, 2B, and 2C illustrate the problem of blunting the corners of the transfer curve, and are correlated to the timing diagram of FIG. 1B. FIG. 2A illustrates an ideal transfer curve for which the corners are shown to be relatively sharp. FIG. 2B illustrates an actual transfer curve of which the corners have been blunted as related to the finite linear range of the amplifiers. FIG. 2C illustrates the levels of the corner errors (a/k/a peak errors).
In attempting to improve the performance of median filters by reducing the corner errors, various circuit designers have developed improved transconductance amplifiers. One such transconductance amplifier that is proposed in the Lin paper discussed above is illustrated in FIG. 3A. In the circuit of FIG. 3A, the transistors M1 to M8 and the current sink I.sub.SS form a two-input winner-take-all circuit, which senses its two inputs V1 and V2 corresponding to two currents I1 and I2. If I1 is greater than I2, then I3 is equal to I.sub.SS, I4 is equal to zero, and I0 is equal to -I.sub.SS, and vice versa. I1 and I2 are controlled by two saturated MOS transistors, M5 and M8, with their gates connected to the inputs V1 and V2. Thus, if V1 is greater than V2, then I1 is less than I2; therefore, I0 will be equal to I.sub.SS, and vice versa.
The Lin circuit described above does help sharpen the corners of the voltage transfer curve. However, this implementation is somewhat unstable and hard to tune for certain image processing applications because the input and output ranges are not sufficient for some circumstances. This is because there are two stages and the gain is too high, so that the filter is unable to achieve a stable range where the output swings are not unacceptably large for the given inputs.
Another improved transconductance amplifier is illustrated in FIG. 3B. The circuit of FIG. 3B is disclosed in "Analogue Median Circuit," by I. Opris and G. Kovacs, Electronics Letters, 30(17):1369-1370, August (1994). This circuit uses a folded topology that can effectively reduce the linear range by decreasing the saturation current. However, one problem with this implementation is that the width of the linear range cannot be made infinitely small because of current mismatches, and any small saturation currents will degrade the frequency response.
Another prior art method for reducing corner errors is to insert a gain stage between the input signals and the differential pair for decreasing the effective width of the linear range, as disclosed in "An Analog Circuit Technique for Finding the Median," by Paul H. Dietz and L. Richard Carley, IEEE Custom Integrated Circuits Conference, 1993. However, the saturation of the gain stage and the additional phase leg tend to degrade the transient response of the circuit and, in addition, long transistors are required for implementing the gain stage.
The present invention is directed to a circuit that overcomes the foregoing and other problems in the prior art. More specifically, the present invention is directed to an analog median filter for image processing that maintains a sharp transfer curve with an acceptable level of stability.